package com.CI.Contact.Commands
{
	import com.CI.Contact.Business.ContactDelegate;
	import com.CI.Contact.Control.OpinionEvent;
	import com.CI.Contact.Control.RequestEvent;
	
	public class ContactCommands implements Command,Responder
	{
		public function ContactCommands()
		{
		}
		public function execute(event : CairngormEvent) : void
		{
			var str : String;
			
			if(str == 'sendRequest')
			{
				var requestEvent : RequestEvent = RequestEvent(event);
				getDelegate.sendObject(requestEvent.request);
			}
			else
			{
				var opinionEvent : OpinionEvent = OpinionEvent(event);
				getDelegate.sendObject(opinionEvent.opinion);
			}
		}
		
		public function onFault(event : *=null) : void
		{
			
		}
		
		public function onResult(event : *=null) : void
		{
		}
		
		protected function get getDelegate(): ContactDelegate
		{
			return new ContactDelegate(this);
		}

	}
}